package com.zhaohanlin.start;


import org.junit.Test;

import java.util.HashSet;


/**
 * @author zhaohanlin
 */

public class GetTest {
    @Test
    public void hashset(){
            HashSet<String> hashSet=new HashSet<>();
        System.out.println(hashSet.isEmpty()?"空":"不为空");
        System.out.println("hash容量"+hashSet.size());
        System.out.println(hashSet.hashCode());
        hashSet.add("a");
        hashSet.add("b");
        hashSet.add("c");
        System.out.println(hashSet.hashCode());
hashSet.remove("c");
hashSet.add("b");
        System.out.println(hashSet.hashCode());
        for (String e:hashSet){
            System.out.println(e);
        }


    }
}

